package dhbw.GUI.Window;

import java.awt.BorderLayout;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

import dhbw.Data.Language;
import dhbw.Data.Settings;
import dhbw.GUI.Panels.PanelInfo;
import dhbw.GUI.Panels.PanelPersonalien;
import dhbw.Roles.User;
import Main.MyController;

public class WindowPersonalien extends JFrame{

	private boolean writeable;
	private MyController myc;
	private User user;
	
	private JTextField tf_name,tf_vorname,tf_street,tf_city,tf_zipcode,tf_phone,tf_mobile,tf_email;
	private JButton bt_save,bt_cancel,bt_edit,bt_close;

	public WindowPersonalien(boolean writeable, MyController myc, User user) {
		this.writeable = writeable;
		this.myc = myc;
		this.user = user;
		build();
	}

	public boolean isWriteable() {
		return writeable;
	}

	public User getUser() {
		return user;
	}

	/**
	 * Build JFrame
	 */
	private void build() {
		this.setTitle(Settings.APPLICATION_NAME+" - "+Language.PERSONALDATA[myc.getLanguage()]);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setIconImage(Settings.LOGO_ICON.getImage());
		this.setBackground(Settings.BG_COLOR);
		this.setResizable(false);
		this.add(BorderLayout.CENTER,new PanelPersonalien(false, myc, user, this));
		
		this.pack();
		myc.centerJFrame(this);
		this.setVisible(true);
	}
}
